package com.jackrain.nea.wms.web.service;


import com.alibaba.dubbo.config.annotation.Service;
import com.alibaba.fastjson.JSONObject;
import com.jackrain.nea.web.SearchCmd;
import com.jackrain.nea.web.face.User;
import com.jackrain.nea.web.service.SearchService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.util.Collection;


@Slf4j
@Component("SearchCmdImpl-wms")
@Service(protocol="dubbo", validation="true", version="100", group= "wms")
public class SearchCmdImpl implements SearchCmd {

    @Autowired
    private SearchService searchService;

    public JSONObject getSearchWords(User user,String words){
        return searchService.getSearchWords(user,words);
    }

    @Override
    public JSONObject fuzzyQueryByAK(User user, String ak, int columnId, String fixedcolumns,int range){
        return searchService.fuzzyQueryByAK(user,ak,columnId,fixedcolumns,range);
    }
    @Override
    public JSONObject fuzzyQueryByAK(User user, String ak, int columnId, String fixedcolumns){
        return searchService.fuzzyQueryByAK(user,ak,columnId,fixedcolumns);
    }

    @Override
    public JSONObject findIDByAK(User user, int columnId, String akValue) {
        return searchService.findIDByAK(user, columnId,akValue);
    }

    @Override
    public JSONObject queryIDByAKs(User user, int columnId, Collection<String> akValue) {
        return searchService.queryIDByAKs(user, columnId, akValue);
    }

    @Override
    public JSONObject querySingle(User userWeb, String fields,String tablename,JSONObject whereKeys) {
        return searchService.querySingle(userWeb, fields,tablename,whereKeys);
    }
}
